﻿namespace LitTools
{
    /// <summary>
    /// 转化器
    /// </summary>
    public abstract class Translater
    {
        /// <summary>
        /// 当前状态机
        /// </summary>
        public StateMechine Mechine { get; private set; }
        /// <summary>
        /// 从状态
        /// </summary>
        public IState FromState { get; private set; }
        /// <summary>
        /// 到状态
        /// </summary>
        public IState ToState { get; private set; }
        /// <summary>
        /// 初始化
        /// </summary>
        /// <param name="stateMechine">状态机</param>
        /// <param name="fromState">从状态</param>
        /// <param name="toState">到状态</param>
        public void Init(StateMechine stateMechine, IState fromState, IState toState)
        {
            Mechine = stateMechine;
            FromState = fromState;
            ToState = toState;
        }
        /// <summary>
        /// 转化检查
        /// </summary>
        /// <returns></returns>
        public abstract bool TranslateCheck();
    }
}